{% extends "base.html" %}
{% block title %}修改{{ request.user.name }}的密码{% endblock %}

{% block headerlink %}
<link href="/static/css/common.css" rel="stylesheet" type="text/css" media="all" />
<link href="/static/css/login_reg.css" rel="stylesheet" type="text/css" media="all" />
{% endblock %}

{% block content %}
<div class="content-area">
<h1>修改{{ request.user.name }}的密码</h1>

{% if editpassword_success %}
<p style="margin-top:20px;color:#060;font-size:20px;">{{ request.user.name }}，你已成功修改密码 :)</p>
<span class="blue-link">
<a href="{{ request.HOME_PAGE_URL }}accounts/profile/">回到我的个人资料页</a>
</span>
{% else %}
<form name="form" method="post" action="">{% csrf_token %}
    <div class="item">
    <label>当前密码</label>
    <input id="password" name="old_password" type="password" class="basic-input" maxlength="20">
    {% if old_password_correct %}
    <span class="tip">请输入当前密码</span>
    {% else %}
    <span class="validate-error">当前密码不匹配</span>
    {% endif %}
    </div>
    
    <div class="item">
    <label>新密码</label>
    <input id="password" name="new_password1" type="password" class="basic-input" maxlength="20">
    <span class="tip">字母、数字或符号，最短6个字符，区分大小写</span>
    </div>
    
    <div class="item">
    <label>确认密码</label>
    <input id="password" name="new_password2" type="password" class="basic-input" maxlength="20">
    {% if password_notMatch %}
    <span class="validate-error">两次输入的密码不一致</span>
    {% else %}
    <span class="tip">请再次输入密码</span>
    {% endif %}
    </div>
    
    <div class="item"  style="margin-top:35px">
    <label>&nbsp;</label>
    <input type="submit" value="修改" id="button" class="btn-submit enabled" title="修改密码">
    </div>
</form>

{% endif %}

</div>
{% endblock %}